package com.goodsogood.union.auth.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by dongguochao on 27/10/2016.
 */
@Entity
@Table(name = "gs_user_info", schema = "gs_user_info")
public class GsUserInfoEntity {
    private String userId;
    private String realName;
    private String loginName;
    private String identityCard;
    private String headImgUrl;
    private String mobilePhone;
    private String password;
    private String passwordSalt;
    private String nation;
    private String nativePlaceCode;
    private String nativePlaceName;
    private String country;
    private Integer createDate;
    private String isIdentityVerify;
    private String isMobileVerify;
    private Integer updateDate;
    private Integer lastLoginDate;
    private String lastLoginIp;
    private String sex;
    private String birthdayMonthDay;
    private String birthday;
    private String memo;
    private Byte isIndex;
    private String userIdNjr;  //娘家人的userId

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "USER_ID", nullable = false, length = 32)
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "REAL_NAME", nullable = true, length = 32)
    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    @Basic
    @Column(name = "LOGIN_NAME", nullable = true, length = 64)
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    @Basic
    @Column(name = "IDENTITY_CARD", nullable = true, length = 18)
    public String getIdentityCard() {
        return identityCard;
    }

    public void setIdentityCard(String identityCard) {
        this.identityCard = identityCard;
    }

    @Basic
    @Column(name = "HEAD_IMG_URL", nullable = true, length = -1)
    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl;
    }

    @Basic
    @Column(name = "MOBILE_PHONE", nullable = true, length = 20)
    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    @Basic
    @Column(name = "PASSWORD", nullable = true, length = 32)
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "PASSWORD_SALT", nullable = true, length = 32)
    public String getPasswordSalt() {
        return passwordSalt;
    }

    public void setPasswordSalt(String passwordSalt) {
        this.passwordSalt = passwordSalt;
    }

    @Basic
    @Column(name = "NATION", nullable = true, length = 32)
    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    @Basic
    @Column(name = "NATIVE_PLACE_CODE", nullable = true, length = 10)
    public String getNativePlaceCode() {
        return nativePlaceCode;
    }

    public void setNativePlaceCode(String nativePlaceCode) {
        this.nativePlaceCode = nativePlaceCode;
    }

    @Basic
    @Column(name = "NATIVE_PLACE_NAME", nullable = true, length = 64)
    public String getNativePlaceName() {
        return nativePlaceName;
    }

    public void setNativePlaceName(String nativePlaceName) {
        this.nativePlaceName = nativePlaceName;
    }

    @Basic
    @Column(name = "COUNTRY", nullable = true, length = 32)
    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    @Basic
    @Column(name = "CREATE_DATE", nullable = true)
    public Integer getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Integer createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "IS_IDENTITY_VERIFY", nullable = true, length = 1)
    public String getIsIdentityVerify() {
        return isIdentityVerify;
    }

    public void setIsIdentityVerify(String isIdentityVerify) {
        this.isIdentityVerify = isIdentityVerify;
    }

    @Basic
    @Column(name = "IS_MOBILE_VERIFY", nullable = true, length = 1)
    public String getIsMobileVerify() {
        return isMobileVerify;
    }

    public void setIsMobileVerify(String isMobileVerify) {
        this.isMobileVerify = isMobileVerify;
    }

    @Basic
    @Column(name = "MEMO", nullable = true)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "UPDATE_DATE", nullable = true)
    public Integer getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Integer updateDate) {
        this.updateDate = updateDate;
    }

    @Basic
    @Column(name = "LAST_LOGIN_DATE", nullable = true)
    public Integer getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Integer lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    @Basic
    @Column(name = "LAST_LOGIN_IP", nullable = true, length = 20)
    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GsUserInfoEntity that = (GsUserInfoEntity) o;

        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (realName != null ? !realName.equals(that.realName) : that.realName != null) return false;
        if (loginName != null ? !loginName.equals(that.loginName) : that.loginName != null) return false;
        if (identityCard != null ? !identityCard.equals(that.identityCard) : that.identityCard != null) return false;
        if (headImgUrl != null ? !headImgUrl.equals(that.headImgUrl) : that.headImgUrl != null) return false;
        if (mobilePhone != null ? !mobilePhone.equals(that.mobilePhone) : that.mobilePhone != null) return false;
        if (password != null ? !password.equals(that.password) : that.password != null) return false;
        if (passwordSalt != null ? !passwordSalt.equals(that.passwordSalt) : that.passwordSalt != null) return false;
        if (nation != null ? !nation.equals(that.nation) : that.nation != null) return false;
        if (nativePlaceCode != null ? !nativePlaceCode.equals(that.nativePlaceCode) : that.nativePlaceCode != null)
            return false;
        if (nativePlaceName != null ? !nativePlaceName.equals(that.nativePlaceName) : that.nativePlaceName != null)
            return false;
        if (country != null ? !country.equals(that.country) : that.country != null) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (isIdentityVerify != null ? !isIdentityVerify.equals(that.isIdentityVerify) : that.isIdentityVerify != null)
            return false;
        if (isMobileVerify != null ? !isMobileVerify.equals(that.isMobileVerify) : that.isMobileVerify != null)
            return false;
        if (updateDate != null ? !updateDate.equals(that.updateDate) : that.updateDate != null) return false;
        if (lastLoginDate != null ? !lastLoginDate.equals(that.lastLoginDate) : that.lastLoginDate != null)
            return false;
        if (lastLoginIp != null ? !lastLoginIp.equals(that.lastLoginIp) : that.lastLoginIp != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = userId != null ? userId.hashCode() : 0;
        result = 31 * result + (realName != null ? realName.hashCode() : 0);
        result = 31 * result + (loginName != null ? loginName.hashCode() : 0);
        result = 31 * result + (identityCard != null ? identityCard.hashCode() : 0);
        result = 31 * result + (headImgUrl != null ? headImgUrl.hashCode() : 0);
        result = 31 * result + (mobilePhone != null ? mobilePhone.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (passwordSalt != null ? passwordSalt.hashCode() : 0);
        result = 31 * result + (nation != null ? nation.hashCode() : 0);
        result = 31 * result + (nativePlaceCode != null ? nativePlaceCode.hashCode() : 0);
        result = 31 * result + (nativePlaceName != null ? nativePlaceName.hashCode() : 0);
        result = 31 * result + (country != null ? country.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        result = 31 * result + (isIdentityVerify != null ? isIdentityVerify.hashCode() : 0);
        result = 31 * result + (isMobileVerify != null ? isMobileVerify.hashCode() : 0);
        result = 31 * result + (updateDate != null ? updateDate.hashCode() : 0);
        result = 31 * result + (lastLoginDate != null ? lastLoginDate.hashCode() : 0);
        result = 31 * result + (lastLoginIp != null ? lastLoginIp.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "SEX", nullable = true)
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "BIRTHDAY_MONTH_DAY", nullable = true, length = 4)
    public String getBirthdayMonthDay() {
        return birthdayMonthDay;
    }

    public void setBirthdayMonthDay(String birthdayMonthDay) {
        this.birthdayMonthDay = birthdayMonthDay;
    }

    @Basic
    @Column(name = "BIRTHDAY", nullable = true, length = 8)
    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "IS_INDEX", nullable = true)
    public Byte getIsIndex() {
        return isIndex;
    }

    public void setIsIndex(Byte isIndex) {
        this.isIndex = isIndex;
    }
    
    @Basic
    @Column(name = "USER_ID_NJR", nullable = true, length = 32)
    public String getUserIdNjr() {
        return userIdNjr;
    }

    public void setUserIdNjr(String userIdNjr) {
        this.userIdNjr = userIdNjr;
    }
}
